function [y] = sinc2dir(x)
% sinc2dir(x)
% 	Parameters:
% 		x:	a sequence
% 
% 	Outputs:
% 		y	a sequence
% 
% 	Purpose fo this code: This code will apply the second derivative of a given sinc function to the values of squence to return a
% 	new sequence.

y = zeros(size(x));
for j=1:length(x)
    %if(x(j)==0) 
    %    y(j) = 0;
    %else
        y(j) = (2*sin(pi*x(j)))/(pi*x(j)^3) - (pi*sin(pi*x(j)))/x(j) - (2*cos(pi*x(j)))/x(j)^2;
        a(j) = ((-pi.*sin(pi.*x(j))).*pi)./(x(j));
        b(j) = (-cos(pi.*x(j)))./((x(j)).^2);
        %c(j) = (-cos(pi.*x(j)))./(pi.*((x(j)).^2));
        d(j) = (2.*sin(pi.*x(j)))./(pi.*((x(j)).^3));
        %y(j) = a(j) + 2.*b(j)+ d(j);
        %a(j) = ((sin(pi.*(x(j)))).*pi)./x(j);
        %b(j) = (3.*cos(pi.*(x(j))))./(x(j)).^2;
        %c(j) = (2.*sin(pi.*(x(j))))./(pi.*(x(j)).^3);
        %y(j) = (a(j)+b(j)-c(j));
        %y(j) = (-1).*(a(j)+b(j)-c(j));
        %y(j)=((x(j).*pi-2)./(x(j).^3.*pi)).*((cos(x(j).*pi))+(sin(x(j).*pi)));
        %y(j) = (-1).*(((x(j)).^-1).*(sincdir(x(j))+(sin(x(j).*pi)).*(x(j)))-((x(j)).^-2).*(sinc(x(j))-cos(x(j).*pi)));
        %y(j) = (-1).*(sincdir(x(j)).*((x(j)-1)./x(j))+sin(pi.*x(j)));
        %a(j) = (-2./pi).*((x(j)).^-3);
        %b(j) = sin(pi.*(x(j)))-cos(pi.*(x(j))).*(x(j)).*pi;
        %c(j) = (1./pi).*((x(j)).^-2);
        %d(j) = cos(pi.*x(j)).*pi;
        %f(j) = sin(pi.*(x(j))).*(pi).*(x(j)).*pi;
        %g(j) = cos(pi.*(x(j)).*pi);
        %y(j) = a(j).*b(j)+c(j).*(d(j)+f(j)-g(j));
    end
end

